
<%@ page import="activity.Reader" %>
<!DOCTYPE html>
<html>
	<head>
                <meta name="layout" content="backend">
		<g:set var="entityName" value="${message(code: 'reader.label', default: 'Reader')}" />
		<title><g:message code="default.list.label" args="[entityName]" /></title>
	</head>
	<body>
		<a href="#list-reader" class="skip" tabindex="-1"><g:message code="default.link.skip.label" default="Skip to content&hellip;"/></a>
		<div class="gnav" role="navigation">
			<ul>
				<li><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></li>
			</ul>
		</div>
		<div id="list-reader" class="content scaffold-list" role="main">
			<h1><g:message code="default.list.label" args="[entityName]" /></h1>
                        <g:form action="search">
                            <g:select name="field" from="${['身分證號','姓名']}" />
                            <g:textField name="txt"/>
                            <g:submitButton name="search" value="搜尋" class="btn btn-primary" />
                        </g:form>
			<g:if test="${flash.message}">
			<div class="message" role="status">${flash.message}</div>
			</g:if>
			<table>
				<thead>
					<tr>
					
						<g:sortableColumn property="name" title="${message(code: 'reader.name.label', default: 'Name')}" />
					
						<g:sortableColumn property="gender" title="${message(code: 'reader.gender.label', default: 'Gender')}" />
					
						<g:sortableColumn property="birth" title="${message(code: 'reader.birth.label', default: 'Birth')}" />
					
						<g:sortableColumn property="CID" title="${message(code: 'reader.CID.label', default: 'CID')}" />
					
						<g:sortableColumn property="service" title="${message(code: 'reader.service.label', default: 'Service')}" />
					
						<g:sortableColumn property="title" title="${message(code: 'reader.title.label', default: 'Title')}" />
					
					</tr>
				</thead>
				<tbody>
				<g:each in="${readerInstanceList}" status="i" var="readerInstance">
					<tr class="${(i % 2) == 0 ? 'even' : 'odd'}">
					
						<td><g:link action="show" id="${readerInstance.id}">${fieldValue(bean: readerInstance, field: "name")}</g:link></td>
					
						<td>${fieldValue(bean: readerInstance, field: "gender")}</td>
					
						<td><g:formatDate date="${readerInstance.birth}" /></td>
					
						<td>${fieldValue(bean: readerInstance, field: "CID")}</td>
					
						<td>${fieldValue(bean: readerInstance, field: "service")}</td>
					
						<td>${fieldValue(bean: readerInstance, field: "title")}</td>
					
					</tr>
				</g:each>
				</tbody>
			</table>
			<div class="pagination">
				<m:paginate total="${readerInstanceTotal}" />
			</div>
		</div>
	</body>
</html>
